package cn.lopr.im.android.mvp.view.adapters;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import cn.lopr.im.android.R;


public class SpinnerAdapter extends BaseAdapter {
    String[] str;
    Context context;


    public SpinnerAdapter(String[] strs, Context context) {
        this.str = strs;
        this.context = context;
    }

    @Override
    public int getCount() {
        return str.length;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view == null) {
            view = View.inflate(this.context, R.layout.spinner_item, null);
        }

        TextView tvTitle = view.findViewById(R.id.tv_title);
        tvTitle.setText(str[i]);

        return view;
    }
}